package app.frequentpatterns.fpgrowth;

import java.util.ArrayList;
import java.util.List;

public class CofiNode{
	int itemID = -1;  // item id
	int counter = 1;  // frequency counter
	int participation ;
	CofiNode parent = null; 
	List<CofiNode> childs = new ArrayList<CofiNode>();
	
	CofiNode nodeLink = null; // link to next node with the same item id (for the header table).
	public CofiNode getChildWithID(int id) {
		for(CofiNode child : childs){
			if(child.itemID == id){
				return child;
			}
		}
		return null;
	}
	CofiNode (){
		this.participation=0;
	}
	CofiNode (int itemID){
		this.itemID = itemID;	
		this.participation=0;
	}
}
